//
//  ShopBrowseDetaiController.m
//  YIChuSeller
//
//  Created by 田小椿 on 2018/12/4.
//  Copyright © 2018年 xiangshengjun. All rights reserved.
//

#import "GXShopBrowseDetailController.h"

@interface GXShopBrowseDetailController ()
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *backButtonTop;
@property (weak, nonatomic) IBOutlet UIImageView *backImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *detailLabel;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;

@end

@implementation GXShopBrowseDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.backButtonTop.constant = Height_StatusBar + 5;
    [self creatAllView];
}
- (void)creatAllView
{
    [MenuContentManager selectSingleDishWithServiceId:self.serviceIdString success:^(id responseObject) {
        if (responseObject) {
            [self handleSingleDishData:responseObject];
        }
    } fail:^(id responseObject) {
    }];
}
- (void)handleSingleDishData:(id)responseObject
{
    NSDictionary *contentDic = responseObject[@"result"];
    NSString *urlStr = [NSString stringWithFormat:@"%@/%@",kBaseURL,contentDic[@"dishesImage"]];
    [self.backImageView sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:[UIImage imageNamed:@"placeholder_menuName"]];
    self.nameLabel.text = [NSString stringWithFormat:@"%@",contentDic[@"dishesName"]];
    self.detailLabel.text = [NSString stringWithFormat:@"%@",contentDic[@"describer"]];
    self.numberLabel.text = [NSString stringWithFormat:@"¥%@",contentDic[@"price"]];
}

- (IBAction)pressBackButton:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}


@end
